import { createRouter, createWebHashHistory } from 'vue-router'
import login from '@/views/login.vue'
import index from '@/views/index.vue'
import table from '@/components/index/table.vue'
const routes = [
  {
    path: '/',
    name: '/',
    component: login
  },
  {
    path: '/login',
    name: 'login',
    component: login
  },
  {
    path: '/index',
    name: 'index',
    component: index,
    children: [
      {
        // 当 /user/:id/profile 匹配成功
        // UserProfile 将被渲染到 User 的 <router-view> 内部
        path: 'table',
        component: table,
      },
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
